package online.cmagic.actionType.myiterator;

/**
 * 迭代器模式
 * @author wangsc
 * @date: 2020年04月15日 20:21
 * @since JDK 1.8
 */
public class TestClient {

    public static void main(String[] args) {
        MyCollection list=new MyCollection();
        list.add("zhangsan");
        list.add("lisi");
        MyIterator myIterator = list.newIterator();
        while (myIterator.hasNext()){
            System.out.println(myIterator.next());
        }
    }

}
